{extend name="base:base-add" /}
{block name="style"}
<link rel="stylesheet" href="__LIB__/webuploader/0.1.5/webuploader.css">
{/block}
{block name="title"}
<title>添加文件</title>
{/block}
{block name="form"}
<div class="row clearfix">
    <div class="formControls col-xs-8 col-sm-12">
        {notempty name="data"}
        <ul>
            {volist name="data" id="vo"}
            <li style="float: left;margin: 2px;width: 80px;height:80px;" class="thumbnail">
                <a href="javascript:void(0); " onclick="insert_to('/{$vo.aws_key}')" title="插入到"> <img
                        src="{$fileHost}/{$vo.aws_key}"
                        class="img-responsive center-block"></a>
            </li>
            {/volist}
        </ul>
        {/notempty}
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/webuploader/0.1.5/webuploader.js"></script>
<script type="text/javascript">
    function insert_to(aws_key) {
        var img = "{$fileHost}" + aws_key;
        var select = $(".add-img", parent.document);
        select.find('img').attr('src', img);
        select.find('input').attr('value', aws_key);
    }
</script>
{/block}